package cn.liulin.llrenjianjie.controller;

import cn.liulin.llcommon.pojo.response.ResObj;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * cn.liulin.llrenjianjie.controller$
 *
 * @author ll
 * @date 2022-01-17 15:23:52
 **/
@RestController
@RequestMapping("/renjianjie/address")
public class AddressController {

    @Resource
    private RestTemplate restTemplate;

    @GetMapping(value = "/{id}/info")
    public ResObj getXianJieAddressInfo(@PathVariable String id) {
        String url = "http://LL-XIANJIE/xianjie/address/{id}/info";
        ResObj resObj = restTemplate.getForEntity(url, ResObj.class, id).getBody();
        return ResObj.ok(resObj.getData());
    }
}
